Linear model plots

In this tutorial we will discuss about Linear Model Plots. Let us start with Linear relationship models:

Datasets contain much quantitative analysis, and relating those quantities is one of the most important parts to analyze the data, and these linear model’s plot can be analyzed by using two types of plots.

  • lmplot( ) #linear model plot
  • Regplot () #regression plot

Regression plots:

What is regression and where they will be used, these things will be discussed in the machine learning tutorials? Just here we would plot linear regression models.

The line plotted is the regression line. 

Lmplot ( ):

heatmap( ):

This type of rectangular plot is known as heat plot. To plot this either we have to correlate the data or construct a pivot table. Here we are working with a data set known as flights, which shows the number of passengers travelled on the flights from 1949 to 1960 during each month.

Let us create a pivot table, which takes three parameters index, columns and value. 

Now we shall plot a heatmap:

Syntax sns.heatmap( pivot_table_name )

Few important parameters:

Annot

This parameter takes a boolean, and as we can see that it is difficult to read the quantity of each box, bypassing this parameter as true we can read the data on each box. 

Linewidths:

To create a gap between the box plots. This parameter takes integer values. 

Line-colour:

Basically, the line that divided the box is white in colour, we can change its color by passing the colour name, colour code as a string. 

cmap:

To change the palette of the plot.

This is the end of this tutorial, about Linear model plots.

Spread knowledge

Leave a Comment

Your email address will not be published. Required fields are marked *